package com.aboverock.module.system.runner;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.aboverock.module.system.service.BunitService;
import com.aboverock.module.system.service.DepartmentService;

/**
 * The Class InitBunitsAndDepts.
 *
 * @author Rock Wang
 */
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class InitBunitsAndDepts implements ApplicationRunner {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private BunitService bunitService;

    @Autowired
    private DepartmentService departmentService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        // logger.info("Data-Smart: 初始化体系及部门信息");

        // try {
        //     bunitService.updateBunitsFromDatalake();
        //     departmentService.updateDeptsFromDatalake();
        // } catch (Exception e) {
        //     e.printStackTrace();
        //     logger.warn(e.getMessage());
        // }
    }
}
